﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="msg_recent_list.aspx.cs" Inherits="Ccit.SysPlat.Remind.msg_recent_list" %>

<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.1" Namespace="DevExpress.Web.ASPxGridView"
    TagPrefix="dxwgv" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>在线消息-近期联系人</title>
    <script language="javascript" src="../script/jwindow.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
    
      /* 转发消息 */
      function doForward(vMsgId)
      {
          PageMethods.OperMsg(vMsgId,"","Forward",ClientCallBack);
      }
      
      /* 回复 */
      function doReply(vMsgId,vReceiver)
      {
          PageMethods.OperMsg(vMsgId,vReceiver,"Reply",ClientCallBack);
      }
      
      /* 查询 */
      function GetFuzzy()
      {
          __doPostBack("lnkSearch","");
      }
      /* 查看消息记录 */
      function doViewMsg(vMsgId,vRecentId)
      {
          PageMethods.OperMsg(vMsgId,vRecentId,"ViewMsg",ClientCallBack);
      }
       /* 折叠 */
      function doCollapse()
      {
         var tabCtrl = document.getElementById("tabQuery");
         var tabAttr = tabCtrl.style.display;
         if(tabAttr == "none")
           tabCtrl.style.display = "block";
         else
           tabCtrl.style.display = "none";
      }
      
      function ClientCallBack(vResult)
      {
//         var vResultArr = vResult.split("_");
          //         var vType = vResultArr[0];
          if (vResult == null || vResult == "") return;
          eval("var resultObj=" + vResult);
          var operType = resultObj.operType;
          switch (operType)
          {
             case "ViewMsg":  //查看消息记录
                 var recentId = resultObj.recentId;
                 var vPageParam = "RecentId=" + recentId;
                 var encodeParam = base64encode(vPageParam);
                 OpenWindow("msg_recent_msgview.aspx?" + encodeParam, "", "700", "600");
                 break;
             case "Reply":  //回复
                 var receiverId = resultObj.receiverId;
                 var vPageParam = "RecevierId=" + receiverId + "&PageSource=5";
                 var encodeParam = base64encode(vPageParam);
                 OpenWindow("msg_receive_back.aspx?" + encodeParam, "", "500", "380");
                 break;
             case "Forward":   //转发
                 var msgId = resultObj.msgId;
                 var vPageParam = "MsgId=" + msgId + "&PageSource=5";
                 var encodeParam = base64encode(vPageParam);
                 OpenWindow("msg_send_edit.aspx?" + encodeParam, "", "700", "600");
                 break;
          }
      }
    </script>
</head>
<body>
    <ccit:ActionForm id="form1" runat="server">
      <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
      </asp:ScriptManager>
      <asp:LinkButton ID="lnkSearch" runat="server" Visible="false"></asp:LinkButton>
      <table cellpadding="0" cellspacing="0" class="tbToolbar" width="98%" align="center">
        <tr>
          <td align="left">
            <div class="tbSeparator"></div>
          </td>
          <td width="95%" class="titlebar">在线消息-近期联系人</td>
          <td width="5%">
              <a href="javascript:doCollapse()" class="linktext" title="折叠"><img src="../images/hidemenu.gif"/></a>
          </td>
          <td align="right">
            <div class="tbSeparator"></div>
          </td>
        </tr>
      </table>
       
      <table id="tabQuery" cellpadding="0" runat="server" cellspacing="0" align="center" width="98%"  height="5px" style="margin-top:3px">
         <tr>
           <td>
              <fieldset style="width:100%">
                 <table cellpadding="0" cellspacing="0" width="100%" align="center" height="3px" >
                  <tr>
                    <td style="width:20%">
                     <nobr>
                      内容 <input type="text" runat="server"  class="input" id="txtContent"  style="width:100px"/>
                     </nobr> 
                    </td>
                    <td style="width:20%">
                      <nobr>
                        联系人 <input type="text" runat="server" id="txtRecenter"  class="input"  style="width:100px"/>
                      </nobr>
                    </td>
                    <td style="width:58%" align="right">
                       <nobr>
                            <a href="javascript:GetFuzzy()" title="查询" class="linktext">
                                <img src="../images/toolbar/search.gif" />
                            </a>
                        </nobr>
                    </td>
                    
                    <td  style="width:2%">
                      &nbsp;
                    </td>
                  </tr>
                 </table>
              </fieldset>
           </td>
         </tr>
        </table>
        
        
        <table cellpadding="0" cellspacing="0" align="center" width="98%"  height="5px" style="margin-top:3px;">
          <tr>
            <td style="width:5%">
             <nobr>
              图例:
             </nobr> 
            </td>
            <td style="width:77%" align="left">
              <nobr> 
                    <img src="../images/toolbar/reply.GIF" />回复&nbsp;
                    <img src="../images/toolbar/turn.GIF" />转发
              </nobr>
            </td>
          </tr>
        </table>
        
        
        <table cellpadding="0" cellspacing="0" width="98%" border="0" align="center" valign="top" style="margin-top:3px;">
          <tr>
            <td>
              <dxwgv:ASPxGridView ID="gvRecent" runat="server" Width="100%" align="center"  
                    KeyFieldName="MsgId" onhtmlrowcreated="gvRecent_HtmlRowCreated">
                <Columns>
                    <dxwgv:GridViewDataTextColumn Caption="" FieldName="MsgId" VisibleIndex="1" Visible="false"></dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="联系人" FieldName="ReceiverId" VisibleIndex="1" Width="10%">
                        <HeaderStyle HorizontalAlign="Center" />
                        <CellStyle HorizontalAlign="Center" Wrap="False"></CellStyle>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="最后联系内容" FieldName="SendContent" VisibleIndex="2" Width="65%">
                        <HeaderStyle HorizontalAlign="Center"/>
                        <CellStyle HorizontalAlign="left" Wrap="False"></CellStyle>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="最后联系时间" FieldName="ReceiveTime" VisibleIndex="3" Width="15%">
                        <HeaderStyle HorizontalAlign="Center" />
                        <CellStyle HorizontalAlign="Center" Wrap="False"></CellStyle>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="是否为当前用户发送的信息" FieldName="MsgType" Visible="false" Width="15%">
                        <HeaderStyle HorizontalAlign="Center" />
                        <CellStyle HorizontalAlign="Center" Wrap="False"></CellStyle>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="操作" VisibleIndex="4" Width="10%">
                        <HeaderStyle HorizontalAlign="Center" />
                        <CellStyle HorizontalAlign="Center" Wrap="False"></CellStyle>
                        <DataItemTemplate>
                            <a id="haForward" runat="server"  title="转发" style="cursor:hand;"><img src="../images/toolbar/turn.GIF" /></a>&nbsp;
                            <a id="haReply" runat="server" title="回复" style="cursor:hand;"><img src="../images/toolbar/reply.GIF" /></a>
                        </DataItemTemplate>
                    </dxwgv:GridViewDataTextColumn>
                </Columns>
                
                <SettingsPager AlwaysShowPager="True" PageSize="10">
                    <FirstPageButton Visible="True">
                    </FirstPageButton>
                    <LastPageButton Visible="True">
                    </LastPageButton>
                </SettingsPager>
                <Styles>
                    <Row CssClass=""></Row>
                    <AlternatingRow  CssClass="" Enabled="true"/>
                    <SelectedRow  CssClass=""></SelectedRow>
                </Styles>
                 <%-- 可调整列宽--%>
                <SettingsBehavior ColumnResizeMode="Control" />
               </dxwgv:ASPxGridView>
            </td>
          </tr>
        </table>
    </ccit:ActionForm>
</body>
</html>
